import type { App } from 'vue';
// import { Button } from './Button';
// import { Input, Layout } from 'ant-design-vue';

import Antd from 'ant-design-vue';
import DatePicker from 'ant-design-vue/es/date-picker/moment';
import TimePicker from 'ant-design-vue/es/time-picker/moment';
import Calendar from 'ant-design-vue/es/calendar/moment';
import { VueClipboard } from '@soerenmartius/vue3-clipboard'
import Icon from '/@/components/Icon/Icon.vue';
import coreStyle from '/@/tool/coreStyle';
import { toParam } from '/@/tool/Param';
import coreTool from '/@/tool/coreTool';
import { getTreeTkeys } from '/@/tool/coreTool';

import Dict from './CoreComp/Dict.vue';
import FileUpload from './CoreComp/FileUpload.vue';
import FileSelect from './CoreComp/FileSelect.vue';
import DateYear from './CoreComp/DateYear.vue';
import DateMonth from './CoreComp/DateMonth.vue';
import DateDay from './CoreComp/DateDay.vue';
import DateTime from './CoreComp/DateTime.vue';
import DateDayRange from './CoreComp/DateDayRange.vue';
import DateTimeRange from './CoreComp/DateTimeRange.vue';
import DateUnixTime from './CoreComp/DateUnixTime.vue';
import DateUnixTimeRange from './CoreComp/DateUnixTimeRange.vue';
import SwitchPostLogin from './CoreComp/SwitchPostLogin.vue';
import ActProcessEditor from './CoreComp/ActProcessEditor/ActProcessEditor.vue';
import CodeEditor from './CoreComp/CodeEditor/CodeEditor.vue';
import CodeEditorXml from './CoreComp/CodeEditorXml/CodeEditorXml.vue';
import CodeEditorSql from './CoreComp/CodeEditorSql/CodeEditorSql.vue';
import CodeEditorJson from './CoreComp/CodeEditorJson/CodeEditorJson.vue';

import VXETable from 'vxe-table';

export function registerGlobComp(app: App) {
  // app.use(Input).use(Button).use(Layout).use(VXETable);
  app.use(DatePicker);
  app.use(TimePicker);
  app.use(Calendar);
  app.use(Antd);
  app.use(VueClipboard);
  app.use(VXETable);

  app.component('CoreIcon', Icon);
  app.component('Dict', Dict);
  app.component('FileUpload', FileUpload);
  app.component('FileSelect', FileSelect);
  app.component('DateYear', DateYear);
  app.component('DateMonth', DateMonth);
  app.component('DateDay', DateDay);
  app.component('DateTime', DateTime);
  app.component('DateDayRange', DateDayRange);
  app.component('DateTimeRange', DateTimeRange);
  app.component('DateUnixTime', DateUnixTime);
  app.component('DateUnixTimeRange', DateUnixTimeRange);
  app.component('SwitchPostLogin', SwitchPostLogin);
  app.component('ActProcessEditor', ActProcessEditor);
  app.component('CodeEditor', CodeEditor);
  app.component('CodeEditorXml', CodeEditorXml);
  app.component('CodeEditorSql', CodeEditorSql);
  app.component('CodeEditorJson', CodeEditorJson);

  app.config.globalProperties.coreStyle = coreStyle;
  app.config.globalProperties.$toParam = toParam;
  app.config.globalProperties.$getUUID36 = coreTool.getUUID36;
  app.config.globalProperties.$getUUID32 = coreTool.getUUID32;
  app.config.globalProperties.$copyProperties = coreTool.copyProperties;
  app.config.globalProperties.$toSearch = coreTool.toSearch;
  app.config.globalProperties.$getTreeTkeys = getTreeTkeys;
}
